package cc.comac.mom.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import cc.comac.mom.api.EquipRegularCheckPlanService;
import cc.comac.mom.bean.EquipRegularCheckPlan;
import cc.comac.mom.bean.EquipRegularCheckPlanBean;
import cc.comac.mom.util.ResultBean;
import io.swagger.annotations.ApiOperation;

@RestController
@RequestMapping(value = "/EquipRegularCheckPlan")
public class EquipRegularCheckPlanController {

	@Autowired
	private EquipRegularCheckPlanService equipRegularCheckPlanService;
	
	@ApiOperation("新增点检计划")
	@RequestMapping("/insert")
	public ResultBean insert(@RequestBody EquipRegularCheckPlan obj) {
		return equipRegularCheckPlanService.insert(obj);
	}
	@ApiOperation("批量新增点检计划")
	@RequestMapping("/insertBatch")
	public ResultBean insertBatch(@RequestBody List<EquipRegularCheckPlan> list) {
		return equipRegularCheckPlanService.insertBatch(list);
	}
	
	@ApiOperation("修改点检计划")
	@RequestMapping("/update")
	public ResultBean update(@RequestBody EquipRegularCheckPlan obj) {
		return equipRegularCheckPlanService.update(obj);
	}
	
	@ApiOperation("批量删除点检计划")
	@RequestMapping("/deleteBatch")
	public ResultBean deleteBatch(@RequestBody List<EquipRegularCheckPlan> list) {
		return equipRegularCheckPlanService.deleteBatch(list);
	}
	
	@ApiOperation("生效/失效点检计划")
	@RequestMapping("/disableEquipReqularCheckByIds")
	public ResultBean disableEquipReqularCheckByIds(@RequestBody List<Long> list) {
		return equipRegularCheckPlanService.disableEquipReqularCheckByIds(list);
	}
	
	@ApiOperation("分页查询点检计划")
	@RequestMapping("/selectByFields")
	public ResultBean selectByFields(@RequestBody  EquipRegularCheckPlanBean obj) {
		return equipRegularCheckPlanService.selectByFields(obj);
	}
	
	@ApiOperation("批量发布点检计划")
	@RequestMapping("/planIssue")
	public ResultBean planIssue(@RequestBody List<Long> list) {
		return equipRegularCheckPlanService.planIssue(list);
	}
}
